<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app" data-tid="tid">
    <button id="btn">++</button>
    <button id="text">0</button>
  </div>
</body>

<script src="./reactive.js"></script>

<script type="module">
  const data = {
    count: 1
  }

  const ob = new Observe(data)
  const text = document.getElementById('text')

  const plus = computed(() => {
    return data.count + 1
  })



  watch(() => {
    return data.count
  }, (newVal, oldVal) => {
    console.log(`新值为${newVal},旧值为${oldVal}`);
    console.log(plus.value);
  })



  document.getElementById('btn').addEventListener('click', () => {
    data.count++

  })

</script>

</html>